import { request } from "../utils";
export function getChannelAPI() {
  return request({
    url: "/channels",
    method: "get",
  });
}
export function createArticleAPI(data) {
  return request({
    url: "/mp/articles?draft=false",
    method: "post",
    data,
  });
}
// 获取文章列表
export function getArticleListAPI(params) {
  return request({
    url: "/mp/articles",
    method: "get",
    params,
  });
}
// 删除文章
export function deleteArticleAPI(id) {
  return request({
    url: `/mp/articles/${id}`,
    method: "delete",
  });
}
// 获取文章详情
export function getArticleDetailAPI(id) {
  return request({
    url: `/mp/articles/${id}`,
    method: "get",
  });
}
// 编辑更新文章
export function updateArticleAPI(data) {
  return request({
    url: `/mp/articles/${data.id}?draft=false`,
    method: "put",
    data,
  });
}
